package com.item.read.action;

import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.ui.MessageType;
import com.intellij.openapi.ui.popup.Balloon;
import com.intellij.openapi.ui.popup.JBPopupFactory;
import com.intellij.ui.awt.RelativePoint;
import com.item.read.ContentAction;
import com.item.read.dialog.SampleDialogWrapper;

import javax.swing.*;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkListener;
import javax.swing.text.Position;
import java.awt.*;

public class ReverAction extends AnAction {
//    private static final NotificationGroup NOTIFICATION_GROUP =
//            new NotificationGroup("Custom Notification Group", NotificationDisplayType.NONE, true);

    @Override
    public void actionPerformed(AnActionEvent e) {
      ContentAction.clear();
//      Notification  notification =  NOTIFICATION_GROUP.createNotification("1111111111", NotificationType.INFORMATION);
//      notification.notify(e.getProject());
   //   EventLog.expireNotification(notification);
//        if (new SampleDialogWrapper().showAndGet()) {
//            // user pressed OK
//        }
//        JLayeredPane jLayeredPane = new JLayeredPane();
//        jLayeredPane.setPreferredSize(new Dimension(100,100));
//        JTextField jTextField = new JTextField();
//        jLayeredPane.add(jTextField);

//        JBPopupFactory.getInstance().createHtmlTextBalloonBuilder("<html><body>12312313</body></html>", MessageType.INFO, new HyperlinkListener() {
//            @Override
//            public void hyperlinkUpdate(HyperlinkEvent e) {
//
//            }
//        }).createBalloon().show(new RelativePoint(new Point(1,1)), Balloon.Position.below);
                //.createBalloon().show(new RelativePoint(new Point(1,1)));
//        JBPopupFactory.getInstance().createComponentPopupBuilder(jLayeredPane,jTextField).createPopup()
//                .show(new RelativePoint(new Point(100,100)));
    }
}
